/**
 * 
 */
package com.googlecode.bestpaper.output.pdf.table;

import com.googlecode.bestpaper.output.pdf.PDFHelper;
import com.googlecode.bestpaper.syntax.table.BPCell;
import com.lowagie.text.BadElementException;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;

/**
 * @author xalinx at gmail dot com
 * @date Dec 4, 2009
 */
public class PDFCell extends BPCell<Table, Paragraph> {

	/**
	 * @param conent
	 */
	public PDFCell(String content) {
		super(content);
	}

	/**
	 * 
	 */
	public PDFCell() {
		// TODO Auto-generated constructor stub
	}

	@Override
	protected Paragraph buildSelf(Table table, int fontStyle) throws Exception {
		Font font = PDFHelper.getCNFont();
		Paragraph p = new Paragraph(getContent(), font);
		return p;
	}

	@Override
	protected void finishBuild(Table table, Paragraph out) throws BadElementException {
		table.addCell(out);
	}

}
